<?php
define('VERSION', '0.1'); // 当前框架版本

if (substr(PHP_VERSION, 0, 1) != '5')exit("框架环境要求PHP5！");

// 载入核心函数库
require_once(LIB."/function.php");

// 载入配置文件
$GLOBALS['config'] = ConfigReady(require(LIB."/config.php"),$spConfig);

//关闭数据自动转义
@set_magic_quotes_runtime(0);

// 自动开启SESSION
if($GLOBALS['config']['auto_session'])@session_start();

// 载入核心MVC架构文件
import($GLOBALS['config']["core_path"]."/controller.php", FALSE, TRUE);
import($GLOBALS['config']["core_path"]."/model.php", FALSE, TRUE);
import($GLOBALS['config']["core_path"]."/view.php", FALSE, TRUE);

// forthxu,构造执行路由
$__module = isset($_REQUEST[$GLOBALS['config']["url_module"]]) ? 
	$_REQUEST[$GLOBALS['config']["url_module"]] : 
	$GLOBALS['config']["default_module"];
$__controller = isset($_REQUEST[$GLOBALS['config']["url_controller"]]) ? 
	$_REQUEST[$GLOBALS['config']["url_controller"]] : 
	$GLOBALS['config']["default_controller"];
$__action = isset($_REQUEST[$GLOBALS['config']["url_action"]]) ? 
	$_REQUEST[$GLOBALS['config']["url_action"]] : 
	$GLOBALS['config']["default_action"];
?>